﻿<%@ Page Title="Search" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Search.aspx.cs" Inherits="Search" %>
<asp:Content ContentPlaceHolderID="MainCPH" runat="Server">
    <h1 class="title">Search</h1>
    <div class="body">
        <asp:ListView ID="ResultsListView" runat="server">
            <LayoutTemplate>
                <h2>Search results</h2>
                <ul>
                    <asp:PlaceHolder ID="ItemPlaceHolder" runat="server" />
                </ul>
            </LayoutTemplate>
            <ItemTemplate>
                <li>
                    <asp:HyperLink runat="server" NavigateUrl='<%# Eval("Slug", "~/Default.aspx?page={0}") %>' Text='<%# Eval("Title") %>' />
                </li>
            </ItemTemplate>
            <EmptyDataTemplate>
                <h2>Search results</h2>
                <p>No pages found.</p>
            </EmptyDataTemplate>
        </asp:ListView>
        <asp:TextBox ID="TextBoxQuery" runat="server" />
    </div>
    <div class="buttons">
        <asp:RequiredFieldValidator runat="server" ControlToValidate="TextBoxQuery" ErrorMessage="Query is missing" Display="None" />
        <asp:ValidationSummary runat="server" />
        <asp:Button ID="SearchButton" runat="server" Text="Search" OnClick="SearchButton_Click" />
    </div>
</asp:Content>
